package io;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class ReadStringDemo {
    public static void main(String[] args) throws IOException {
        File file = new File("fos.txt");
        FileInputStream fis = new FileInputStream(file);
        long len = file.length();
        byte[] buf = new byte[(byte)len];
        fis.read(buf);
        String s = new String(buf, StandardCharsets.UTF_8);
        System.out.println(s);
        fis.close();
    }
}
